/// @description Insert description here
// You can write your code in this editor
var yy = sp;
if(run)
{
	var plac = 0;
	//碰撞判断
	for(var i=0;i<4;i++)
	{
		plac = collision_point(box[i].x, box[i].y+32+sp, oBox, false, true);
		if(plac&&!scrBoxInBoxs(plac,id))
		{
			leng = plac.y-box[i].y-32;
			yy = leng;
			run = false;
			break;
		}
	}
	
	//运动
	for(var i=0;i<4;i++)
	{
		if(!run)
		{
			box[i].y+=leng;
		}
		else
		{
			box[i].y+=sp;
		}
	}
	
	//坐标改变
	y+=yy;
	
	timer++;
	if(timer>_timer)
	{
		timer = 0;
		
		//向右
		if(right&&!scrBoxsGet(32,0))
		{
		
			for(var i=0;i<4;i++)
			{
				box[i].x+=32;
			}
			x+=32;
		}

		//向左
		if(left&&!scrBoxsGet(-32,0))
		{
			for(var i=0;i<4;i++)
			{
				box[i].x-=32;
			}
			x-=32;
		}
	}
	
	//销毁集合
	if(!run)
	{
		//判断消除
		for(var i=0;i<4;i++)
		{
			if(instance_exists(box[i])) 
				scrBoxslineClear(box[i].y);
		}
		instance_destroy(id);	
	}
		
}